Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.IO
Imports DotNetNuke
Namespace NVPortal.Modules.NVNews
    Public MustInherit Class categoriesBREADCRUMB
        Inherits Entities.Modules.PortalModuleBase
        Dim catid As Integer = -1
        Dim itemid As Integer = -1

#Region "Controls"
#End Region

#Region "Event Handlers"
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            If IsNumeric(Request("catid")) Then
                catid = CInt(Request("catid"))
            End If
            If IsNumeric(Request("itemid")) Then
                itemid = CInt(Request("itemid"))
            End If
            If Not IsPostBack Then
                Try
                    If catid <> -1 Then
                        Dim ctlNewsCategory As New NV_NewsCategoriesController
                        Dim objNewsCategory As NV_NewsCategoriesInfo
                        objNewsCategory = ctlNewsCategory.GetByID(catid)
                        Me.lbCategoryName.Text = objNewsCategory.CategoryName
                        If objNewsCategory.ParentId <> 0 Then
                            Me.lbCategoryName.Text = ctlNewsCategory.GetByID(objNewsCategory.ParentId).CategoryName & " > " & Me.lbCategoryName.Text
                        End If
                    Else
                        If itemid <> -1 Then
                            Dim ctlNews As New NV_NewsController
                            Dim ctlNewsCategory As New NV_NewsCategoriesController
                            Dim objNewsCategory As NV_NewsCategoriesInfo
                            objNewsCategory = ctlNewsCategory.GetByID(ctlNews.GetByID(itemid).CategoryId)

                            Me.lbCategoryName.Text = objNewsCategory.CategoryName
                            If objNewsCategory.ParentId <> 0 Then
                                Me.lbCategoryName.Text = ctlNewsCategory.GetByID(objNewsCategory.ParentId).CategoryName & " > " & Me.lbCategoryName.Text
                            End If
                            'Me.lbCategoryName.Text = ctlNews.GetByID(itemid).CategoryName
                        End If
                    End If
                Catch ex As Exception
                    ProcessModuleLoadException(Me, ex)
                End Try
            End If
        End Sub
#End Region


    End Class

End Namespace
